// Copyright 2008 Senary
// See credits.txt for details.

// This file is part of Omega VII.

// Omega VII is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Omega VII is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Omega VII.  If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include <vector>
#include "Player.h"
#include "SpaceObject.h"

enum KeywordType {
	KT_GOLD,
	KT_TIME,
	KT_CONSTRUCT,

	KT_NUMKEYWORDTYPE
};

enum OperatorType {
	OT_SMALLERTHAN,
	OT_GREATTHAN,
	OT_EQUAL,
	OT_EVERY,

	OT_NUMOPERATORTYPE
};

enum ActionType {
	AT_BUILD,
	AT_SETTARGET,
	AT_SETLAND,

	AT_NUMACTIONTYPE
};

class AIPlayer : public Player
{
protected:
	struct Rule* _rules[100];
	bool _stop;

public:
	AIPlayer(void);
	~AIPlayer(void);
	void update(float timestep, float totalTime);
	void stop();
};

struct Action {
	ActionType action;
	SpaceObject* ob1;
	SpaceObject* ob2;
	int value;
};

struct Condition {
	KeywordType op1;
	OperatorType oper;
	int op2;
};

struct Rule {
	struct Condition cond;
	struct Action act;
};
